<template>
  <div class="undeliver order">
    <div class="order-list" v-if="orderList.length>0">
      <div class="order-goods" v-for="(goods,index) in orderList" :key="index" v-show="goods.isPay">
        <div class="order-hd">
          <p class="g-store">
            {{goods.shopTitle}}
            <van-icon name="arrow" />
          </p>
          <p class="g-state">等待卖家发货</p>
        </div>
        <div class="order-bd">
          <img :src="goods.pictUrl" alt="">
          <div class="g-desc">
            <p class="g-title">{{goods.title | ginfofmt}}</p>
            <p class="g-price"><span>单价:</span> {{goods.price | gpricefmt}} 元</p>
            <p class="g-count"><span>数量:</span> {{goods.count}} 件</p>
            <p class="g-total"><span>总价:</span> <b>{{goods.count*goods.price | gpricefmt}} 元</b> </p>
            <p class="g-addtime"><span>创建订单时间:</span> {{goods.add_time | datefmt}}</p>
            <p class="g-addtime"><span>提交订单时间:</span> {{goods.isCompleted_time  | datefmt}}</p>
          </div>
        </div>
        <div class="user-address">
          <p><span>订单编号:</span> {{goods.orderId}}</p>
          <p><span>发货信息:</span> {{goods.name}}, {{goods.tel}}, {{goods.address}}</p>
        </div>
        <div class="order-operate">
          <span class="o-more">更多
            <van-icon name="arrow-down" />
          </span>
          <van-button id="chooseAddress" color="skyblue">联系商家</van-button>
          <van-button id="chooseAddress" type="primary">再买一单</van-button>
          <van-button color="orange">催一催</van-button>
        </div>
      </div>
    </div>
    <div class="no-order" v-else>
      <p>您还未产生订单</p>
    </div>
  </div>
</template>
<script>
import '@/assets/css/order/order.scss'
import { mapState } from 'vuex'
export default {
  data() {
    return {

    }
  },
  computed: {
    ...mapState({
      orderList: state => state.cart.orderList
    })
  }
}
</script>
<style lang="scss" >
.undeliver {
}
.order {
  .order-bd img {
    height: 100px !important;
  }
  .user-address {
    flex-direction: column;
    margin: 5px 0;
    color: #1c1d9d;
    font-size: 14px;
    p {
      width: 100%;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      span {
        font-weight: 600;
      }
    }
  }
}
</style>